UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x3jDBwfbqpZ1ufWnHOJHbVPU2NRgKVpxMhYqLOYQLMY='
WHERE
key_id = '2a73daf2bd218081a5c04c4c626637bbafc6be6011a4b7067ea1230c5d2e6e4f'
AND (
token = 'x3jDBwfbqpZ1ufWnHOJHbVPU2NRgKVpxMhYqLOYQLMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)