UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '80EcBLwiMMxhr2IX272/LHu+/5qZfKmoA2X9mWSrcMc='
WHERE
key_id = '312e573904e282452a06a2e042ad8c0e5155c933736c015d22bd7808abd6fd64'
AND (
token = '80EcBLwiMMxhr2IX272/LHu+/5qZfKmoA2X9mWSrcMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)