UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/sPuxFz+Sf0e2OTslzqvQImZVTrnnFwRxqshDmgXgiQ='
WHERE
key_id = '4b3e4d8ffc266e2be678a489f3ebab6cf670753942dc712a6b6ee7a4e8e1e5ed'
AND (
token = '/sPuxFz+Sf0e2OTslzqvQImZVTrnnFwRxqshDmgXgiQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)