UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IzXG80gDsxEgKn12myHq17JDo8EDgExsYGfC8jEDj5A='
WHERE
key_id = '084f685c9ed7d1916d14376c39da1630f44a2d561908272f0bdd33f64d0d9274'
AND (
token = 'IzXG80gDsxEgKn12myHq17JDo8EDgExsYGfC8jEDj5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)