UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p1IuInsYY9+NFMDct380pAKz3ZvdgV5LGQv/u3+etnA='
WHERE
key_id = '53c8ff8803c746d81d9e5ce86acb214fd03959f7b42bf1d158008b0dea408b09'
AND (
token = 'p1IuInsYY9+NFMDct380pAKz3ZvdgV5LGQv/u3+etnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)