UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5xooEr2OnjbiHbt8L1jbyuKFeXWG4XJE755qWoAklHY='
WHERE
key_id = '5ea43ff99d853ffada9fc453a68840462b6417a9e53107f476e8ddc9e3132468'
AND (
token = '5xooEr2OnjbiHbt8L1jbyuKFeXWG4XJE755qWoAklHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)