UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9mNJaJj+/IYzD58pBFJnbqE/gfpQXfkRjy0lHy1aQJg=' 
WHERE 
  key_id = '063358cc1eeaf78b683d26b135e56747847e09cfe29b2207f1082529420404f4' 
  AND (
    token = '9mNJaJj+/IYzD58pBFJnbqE/gfpQXfkRjy0lHy1aQJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062