UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6f2QoY0aPe3xa+PmBDS3G2bODsQvHCJ8TcjYTeDL85U='
WHERE
key_id = '2acb59cff1e2d812dc3098ddf63656e36cb20e9f3f406aee2793c17001dcd380'
AND (
token = '6f2QoY0aPe3xa+PmBDS3G2bODsQvHCJ8TcjYTeDL85U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)