UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jYLxRstsqjUWgTXy3DUugrO2Dc2Zmzd6Elaaw2fBFlE='
WHERE
key_id = '141b2c5c7315211053b5299c670d1f845a1d421fa0314e901d9ab2d7ff7fc397'
AND (
token = 'jYLxRstsqjUWgTXy3DUugrO2Dc2Zmzd6Elaaw2fBFlE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)