UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sp/zM0nomPI5lwX1w5qGHXvDWrZTQXQzs8oD7bohwg8='
WHERE
key_id = '1e2cde3818be0b0b78d18dc5c1f1cd232d05b6e3e4114164c4d9d1f4fa4cd381'
AND (
token = 'sp/zM0nomPI5lwX1w5qGHXvDWrZTQXQzs8oD7bohwg8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)