UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MxIFV2rHEHxsAVyz1iRYblyzhRbdvz/LG/17NdLA5hE='
WHERE
key_id = '54d5e52a94db851664d0693162f13070c1cdc7af454d8ec5126fe3f29c4b0e94'
AND (
token = 'MxIFV2rHEHxsAVyz1iRYblyzhRbdvz/LG/17NdLA5hE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)