UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cvN5NBSxvU8JTFZdizb0CfnseMbMP/pW7T0a/auewSg=' 
WHERE 
  key_id = '0f69f7c850550212e199ea82cce7783f399abac37acc79d9d21d7ae199a0fc42' 
  AND (
    token = 'cvN5NBSxvU8JTFZdizb0CfnseMbMP/pW7T0a/auewSg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031