UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6s9UuJ+yBfiUWJzYToBAsU6DsULZsDc9KJFmo9IWLrI='
WHERE
key_id = '6963c6352309111fe02c66df23c3498434cd2ab97ff02cec94f1790033cfbdca'
AND (
token = '6s9UuJ+yBfiUWJzYToBAsU6DsULZsDc9KJFmo9IWLrI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)