UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0C9uZrjZ4b/qaIpJrLV6YAzZUElbILyu4X0dFR4cDvE='
WHERE
key_id = 'd955cdcb84e7dea1f730a25d176b0726b35a8841d92a89575112ae5121b764e9'
AND (
token = '0C9uZrjZ4b/qaIpJrLV6YAzZUElbILyu4X0dFR4cDvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)