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