UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3ArHntqSyrCKVzlFbYsY9u1kwWnlTsIyuatAIAaViEM='
WHERE
key_id = 'b74bbec8556465ec7ecc38a22aa386eb2e0ec388400795047df55100efa2dcfa'
AND (
token = '3ArHntqSyrCKVzlFbYsY9u1kwWnlTsIyuatAIAaViEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)