UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pRYDE7Odb7BIk0pEr2UFSc2JiN3lTc/22pz+WZD7Bog='
WHERE
key_id = '1b93972cfb07a4b5b18f7fb5fc411523cc3d35f182be7825e37c648bb66b1016'
AND (
token = 'pRYDE7Odb7BIk0pEr2UFSc2JiN3lTc/22pz+WZD7Bog='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)