UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Ci0q/PlFuL1k03bdYxdPAtA9iRWX6EqEH9aq9ewucE='
WHERE
key_id = '0966cdaf09b1434972a880475b7108002f62b0a77610477f424672d4562125ae'
AND (
token = '/Ci0q/PlFuL1k03bdYxdPAtA9iRWX6EqEH9aq9ewucE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)