UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EiDA/rQT3dPeMo8jFm7xe9CJFXy+JJ9FWbv7sOd+7Fw='
WHERE
key_id = 'a9d32c393f70024863968a583e1c604314a6eddad259c90064fa09a756cf9106'
AND (
token = 'EiDA/rQT3dPeMo8jFm7xe9CJFXy+JJ9FWbv7sOd+7Fw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)