UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4kGi7fQz/O5FOPCer11jfQrj1PevozUSchI38gEYz1w='
WHERE
key_id = '050d7c3c59cf9cb6e4a4186ab38222afe91b24c7bb45c9f06bdb4b639f78db2c'
AND (
token = '4kGi7fQz/O5FOPCer11jfQrj1PevozUSchI38gEYz1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)