UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o5v8LEKCWbDafZOGV+63wtWg3p/qgXpGLpmilMa95jU='
WHERE
key_id = 'bb42712984b1052720b8e40979e37f70fc55da74ce23c1e98a7e4edad4045acd'
AND (
token = 'o5v8LEKCWbDafZOGV+63wtWg3p/qgXpGLpmilMa95jU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)