UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/9YTRpLBHU2gEX5uYL9PXpM206DE0SWcnzjIM3IRB2U='
WHERE
key_id = '9e410abae04d34b75c065556371278311d9a1db4721ff53de9b66496a5836646'
AND (
token = '/9YTRpLBHU2gEX5uYL9PXpM206DE0SWcnzjIM3IRB2U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)