UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6gkxXioJ4MDGwJDFFdrS14KWoND3AVunnRGt8wsNrFk='
WHERE
key_id = 'e551ea98f964d4cd2c9612892b8b1232ac66b5f8d8eceb03c5feabefac8a5c08'
AND (
token = '6gkxXioJ4MDGwJDFFdrS14KWoND3AVunnRGt8wsNrFk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)