UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2zHkK9IL20x5+skFUXqRlbcBRXv2Jbneh3ikq7FVkzs=' 
WHERE 
  key_id = '8a2c7bda50e153b32b448355055366cbad6546d36ab8b0f9afd05133e24bafd3' 
  AND (
    token = '2zHkK9IL20x5+skFUXqRlbcBRXv2Jbneh3ikq7FVkzs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00141