UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ocktL3Nvbuodv0r+V2OR4huS7dpRwtpnGYb3XvT+YGc='
WHERE
key_id = 'ee275bc027f3994296a05e1395247cdbcbc87fba4d9bb582e673b1f3e9dd1414'
AND (
token = 'ocktL3Nvbuodv0r+V2OR4huS7dpRwtpnGYb3XvT+YGc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)