UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2kFV1e2P6ZtCtIy69K0NttExicv3hBrBYY7/FQj0rTk='
WHERE
key_id = '33787c9241efb505c55577359758f57c644ed16834e6790a06131a332e47261f'
AND (
token = '2kFV1e2P6ZtCtIy69K0NttExicv3hBrBYY7/FQj0rTk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)