UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q4uEYgpPIAffOftwu5FKFnly+7gjkS3in0CX4eDKNlI='
WHERE
key_id = '438b72763c83b6eab598879d7f9bdaac99f4077d8b8c2f039697fc92918fbff5'
AND (
token = 'Q4uEYgpPIAffOftwu5FKFnly+7gjkS3in0CX4eDKNlI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)