UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JmTw8Wbb+HSdf+YMzAR/aURMaIMAv8uGXGsbRGnpFz0='
WHERE
key_id = 'ecdcbf528e6ae8808998b05678f2411618e07fb514c8f073880e7375cc559434'
AND (
token = 'JmTw8Wbb+HSdf+YMzAR/aURMaIMAv8uGXGsbRGnpFz0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)