UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qoh659HgGwC2rxPiBdDEHNRrWxzAqwfCTrA2hhPGywI='
WHERE
key_id = '0b6fd2fadc66de5f7ec6f9c5d32f3eba3d1fa70c54b7d20164b167e79a8b532f'
AND (
token = 'qoh659HgGwC2rxPiBdDEHNRrWxzAqwfCTrA2hhPGywI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)