UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Stlsq6GgRPGNXywqODrwL733cUdPLZ7NDhP4bxYIQIk='
WHERE
key_id = 'd8b4be46662369bebc094493845c35d804c1b00f71d85b6739a83211785cec00'
AND (
token = 'Stlsq6GgRPGNXywqODrwL733cUdPLZ7NDhP4bxYIQIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)